<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head></head>
<body style="width: 2000px;">
<script type="text/javascript">

var imagesDialogs;
function toUploadImages(LunBoNum){
	imagesDialogs = Kit.dialog("轮播图片","${BASE_PATH}/bus/goods/store/imageIndex/${goods.LunBoNum}",{closable:true,size:"size-wide"}).open();
}
//详情图片
var imagesXiang;
function toXiang(){
	imagesXiang = Kit.dialog("详情图片","${BASE_PATH}/bus/goods/store/imageDetailIndex/${goods.LunBoNum}",{closable:true,size:"size-wide"}).open();
}
</script> 

<form id="addForm"   class="form-horizontal" enctype="multipart/form-data" style="">
	
	<div class="form-group"  style="margin-left: 20px">
		<label class=" control-label" style="margin-left: 50px;font-size: 18px;">充值卡基本信息</label>
	</div>
	<hr style=" height:2px;border:none;border-top:2px solid black;" />
	<div class="form-group">
	    <label class="col-lg-2 control-label">充值卡名称</label>
	    <div class="col-lg-9">
        	<input type="text" name="names" id="names" readonly="readonly" class="form-control" value="${goods.name}" required maxlength="20">
        	<input type="text" id="doodsid" name="doodsid" readonly="readonly" hidden="hidden" value="${goods.id }"/>
	    </div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">充值卡主图</label>
		<div class="col-sm-10">
			<img src="${FTP_PATH}${goods.thumb}" alt="" style="width:30%;"/>
		</div>
			
	</div>
	<div class="form-group">
	<label class="col-sm-2 control-label">充值卡轮播图</label>
		<div class="col-sm-10">
			 <input type='button' value='查看轮播图' onclick="toUploadImages('${goods.LunBoNum}');" style="background-color: #428bca;width: 89.81px;height: 32px;color: white;border: 2px solid;background-image: linear-gradient(to bottom,#5bc0de 0,#428bca 100%);"/> 
		</div>
		<div class="col-lg-offset-2 p-t-5 col-lg-9"><span class="text-success"></span></div>
	</div>
	<div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>充值卡类别</label>
	    <div class="col-sm-2">
        	<select name="categoryonid" id="categoryonid" class="form-control" required disabled="disabled">
       			<option value="">一级分类</option>
       			<c:forEach items="${oneCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categoryonid==category.categoryId}">selected</c:if>>${category.categoryName}</option>	
				</c:forEach>
        	</select>
	    </div>
	
	    <div class="col-sm-2">
        	<select name="categorytwid" id="categorytwid" class="form-control" required disabled="disabled">
        		<option value="" 
        		<c:forEach items="${twoCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categorytwid==category.categoryId}">selected</c:if>>${category.categoryName}</option>	
				</c:forEach>
				>二级分类</option>
        	</select>
	    </div>
	
	    <div class="col-sm-2">
		    <select name="categorythid" id="categorythid" class="form-control" required disabled="disabled">
	        	<option value=""
        		<c:forEach items="${threeCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categorythid==category.categoryId}">selected</c:if>>${category.categoryName}</option>	
				</c:forEach>
				>三级分类</option>
	        </select>
	    </div>
	
	    <div class="col-sm-2">
		    <select name="categoryfoid" id="categoryfoid" class="form-control" required disabled="disabled">
	        	<option value=""
        		<c:forEach items="${fourCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categoryfoid==category.categoryId}">selected</c:if>>${category.categoryName}</option>	
				</c:forEach>
				>四级分类</option>
	        </select>
	    </div>
	</div>
	<div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>市场售价</label>
	    <div class="col-lg-3">
        	<input type="text" name="sellPrice" id="sellPrice" class="form-control" disabled="disabled" value="${goods.sellPrice}" onkeyup="(this.v3=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v3();" placeholder="请输入充值卡市场价" />
	    </div>
	</div>
	<div class="form-group">
		<label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>商城售价</label>
		<div class="col-lg-9">
			<input type="text" name="marketPrice" id="marketPrice" class="form-control" disabled="disabled" value="${goods.marketPrice}" onkeyup="(this.v3=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v3();" placeholder="请输入充值卡商城价" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>库存数量</label>
		<div class="col-lg-9">
			<input type="text" name="countnum" id="countnum" class="form-control" disabled="disabled" value="${goods.countnum}" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" placeholder="请输入数字" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-lg-2 control-label">充值卡货号</label>
		<div class="col-lg-9">
			<input type="text" id="goodsNum" name="goodsNum" class="form-control" disabled="disabled" value="${goods.goodsNum}" placeholder="请输入第三方充值卡货号">
		</div>
	</div>
	<!-- 是否赠送优惠 -->
	<div class="form-group">
   	 <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>赠送优惠</label>
	    <div class="col-lg-9 zactivity" >
	    	<c:if test="${goods.zsactivity==1 }"><label>否</label></c:if>
			<c:if test="${goods.zsactivity==2 }"><label>是</label><br>
				<c:if test="${goods.zspoint==1 }">
					<label>积分值:${goods.zspointnum }</label><br>
				</c:if>
				<c:if test="${goods.zsdedu==1 }">
					<label>抵扣券:${goods.zsdedunum }</label><br>
				</c:if>
				<c:if test="${goods.zscoupon==1 }">
					<label>优惠券:${goods.zscouponnum }</label><br>
				</c:if>
			</c:if>
   		</div>
   	</div>
	<div class="form-group">
	    <label class="col-lg-2 control-label">适用分公司</label>
	    <div class="col-lg-9">
    		 <span>已选分公司(<span id="chooseNum" >${goods.countStore }</span>)</span>
	    </div>
	     <div class="col-lg-9">
	     	<table id="tablea" style="width: 100%" border="1">
     			<tr>
     				<th  width="15%" style="font-size: 14px;text-align: center;">分公司名称</th>
     				<th  width="20%" style="font-size: 14px;text-align: center;">分公司地址</th>
     				<th  width="10%" style="font-size: 14px;text-align: center;">分公司电话</th>
     			</tr>
     			<c:if test="${fn:length(store) > 0}">
					<c:forEach var="ad" items="${store}" varStatus="s">
					<tr>
						 <td style="font-size: 14px;text-align: center;">${ad.title }</td>
						 <td style="font-size: 14px;text-align: center;">${ad.address }</td>
						 <td style="font-size: 14px;text-align: center;">${ad.tel }</td>
					<tr>
					</c:forEach>
				</c:if>
	     	</table>
	    </div>
	</div>
	
	<div class="form-group">
		<label class=" control-label" style="margin-left: 50px;font-size: 18px;">充值卡详情</label>
	</div>
		<hr style=" height:2px;border:none;border-top:2px solid black;"/>
	

	<div class="form-group">
	    <label class="col-lg-2 control-label">充值卡简介</label>
	    <div class="col-lg-9">
	        <textarea rows="5"readonly="readonly" cols="80" name="shortinfo" onchange="this.value=this.value.substring(0, 200)" onkeydown="this.value=this.value.substring(0, 200)" onkeyup="this.value=this.value.substring(0, 200)" id="shortinfo">${goods.shortInfo }</textarea>
	    </div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label"><span style="margin-right:10px; color:red;">*</span>详情图片</label>
		<div class="col-sm-10">
		 <input type='button' value='查看详情图片' onclick="toXiang();" style="background-color: #337ab7;width: 100px;height: 32px;color: white;border: 2px solid;background-image: linear-gradient(to bottom,#5bc0de 0,#428bca 100%);"/> 
		</div>
		<div class="col-lg-offset-2 p-t-5 col-lg-9"><span class="text-success"></span></div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">备注</label>
		<div class="col-sm-10">
	        <textarea rows="5" readonly="readonly" cols="80" name="beizhu" onchange="this.value=this.value.substring(0, 200)" onkeydown="this.value=this.value.substring(0, 200)" onkeyup="this.value=this.value.substring(0, 200)" >${goods.beizhu}</textarea>
		</div>
	</div>
	
	<input type="hidden" name="thumbOld" value="${goods.thumb}"/>
	<input type="hidden" name="id" value="${goods.id}"/>
	<input type="hidden" name="LunBoNum" value="${goods.LunBoNum}"/>
</form>
</body>
</html>